using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class newFoodExchangeMap : EntityTypeConfiguration<newFoodExchange>
    {
        public newFoodExchangeMap()
        {
            // Primary Key
            this.HasKey(t => t.food_id);

            // Properties
            this.Property(t => t.food_name)
                .HasMaxLength(100);

            this.Property(t => t.food_type)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("newFoodExchange");
            this.Property(t => t.food_id).HasColumnName("food_id");
            this.Property(t => t.food_name).HasColumnName("food_name");
            this.Property(t => t.food_weight).HasColumnName("food_weight");
            this.Property(t => t.food_type).HasColumnName("food_type");
        }
    }
}
